﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.ComponentModel.DataAnnotations;
using BCCommon.OAEnums;
using BCDto.OA.WorkflowTemplate.WorkflowTemplateFormCustomDatabaseTable;
using Newtonsoft.Json;

namespace BCDto.OA.WorkflowTemplate.WorkflowTemplateStepFormDatabaseConfig
{
	/// <summary>
	/// 工作流模板步骤表单数据源配置
	/// </summary>
	public class WorkflowTemplateStepFormDatabaseConfigRequestDto
	{
		/// <summary>
		/// 数据源类型
		/// </summary>		
		[Display(Name = "数据源类型")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[JsonProperty("source_type")]
		public OADataSourceType DataSourceType { get; set; }
		/// <summary>
		/// 数据源数据库名称
		/// </summary>		
		[Display(Name = "数据源数据库名称")]
		[MaxLength(100, ErrorMessage = "{0} 长度应小于{1}")]
		public string DatabaseName { get; set; }
		/// <summary>
		/// 数据库注释
		/// </summary>		
		[Display(Name = "数据库注释")]
		[MaxLength(100, ErrorMessage = "{0} 长度应小于{1}")]
		public string DatabaseComment { get; set; }
		/// <summary>
		/// 表单分类Code
		/// </summary>		
		[Display(Name = "表单分类Code")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[MaxLength(50, ErrorMessage = "{0} 长度应小于{1}")]
		public string FormCategoryCode { get; set; }
		/// <summary>
		/// 表单配置Code
		/// </summary>		
		[Display(Name = "表单配置Code")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[MaxLength(100, ErrorMessage = "{0} 长度应小于{1}")]
		public string FormConfigCode { get; set; }
		/// <summary>
		/// 表数据信息列表
		/// </summary>		
		[Display(Name = "表数据信息列表")]
		public List<WorkflowTemplateFormCustomDatabaseTableRequestDto> Tables { get; set; }
	}
}

